<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/6 0006
 * Time: 下午 5:53
 */

namespace app\admin\model;


use think\Model;

class Jifen extends Model
{
    public static function getrest($id){
        $inc = self::where(['uid'=>$id,'type'=>[1,2,3,5]])->sum('jifen');
        $dec = self::where(['uid'=>$id,'type'=>4])->sum('jifen');
        return ($inc-$dec);
    }
}